package product;

public class Movie {
    private String name; // 片名
    private String director; // 导演
    private String actors; // 主演
    private String intro; // 剧情简介
    private int duration; // 时长（分钟）
    private double score; // 评分（0-10）
    private boolean isShowing; // 是否上映

    public Movie(String name, String director, String actors, String intro, int duration, double score, boolean isShowing) {
        this.name = name;
        this.director = director;
        this.actors = actors;
        this.intro = intro;
        this.duration = duration;
        this.score = score;
        this.isShowing = isShowing;
    }

    // Getter和Setter
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public String getDirector() { return director; }
    public void setDirector(String director) { this.director = director; }
    public String getActors() { return actors; }
    public void setActors(String actors) { this.actors = actors; }
    public String getIntro() { return intro; }
    public void setIntro(String intro) { this.intro = intro; }
    public int getDuration() { return duration; }
    public void setDuration(int duration) { this.duration = duration; }
    public double getScore() { return score; }
    public void setScore(double score) { this.score = score; }
    public boolean isShowing() { return isShowing; }
    public void setShowing(boolean showing) { isShowing = showing; }

    // 显示影片信息
    public void displayInfo() {
        System.out.printf("片名：%s\n导演：%s\n主演：%s\n简介：%s\n时长：%d分钟\n评分：%.1f/10分\n状态：%s\n",
                name, director, actors, intro, duration, score, isShowing ? "上映中" : "未上映");
    }
}